/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Apr 19, 2009 8:24:54 PM $
 *
 * Author: Eric Yang
 * Date  : Apr 19, 2009 8:24:54 PM
 *
 */
package org.geln.util;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author Eric Yang
 * @version 1.0
 */
public class ClassUtil {
	public static InputStream getConfigureAsStream(String resource) throws IOException {
		InputStream in = null;
		ClassLoader loader = ClassUtil.class.getClassLoader();
		if (loader != null)
			in = loader.getResourceAsStream(resource);
		if (in == null)
			in = ClassLoader.getSystemResourceAsStream(resource);
		if (in == null)
			throw new IOException("Could not find resource \"" + resource + "\"!");
		return in;
	}
}
